package org.example;

public class MyThread {

    static String name2 = "bbb";

    String name="defaultName";

    public MyThread() {
        System.out.println("(父类)MyThread无参构造执行了");
    }

    {
        System.out.println("(父类)MyThread的构造代码块执行了");
    }

    public MyThread(String name) {
        System.out.println("(父类)MyThread有参构造执行了-----传入的name="+name);
    }


    public void run() {
        System.out.println("(父类)MyThread的run方法执行了------成员字段name="+name
        +"-----this.getClass()="+this.getClass().getName());
    }
}
